﻿/**
 * Copyright 2010 Dave Keen
 * http://www.actionscriptdeveloper.co.uk
 * 
 * This file is part of Flextrine.
 * 
 * Flextrine is free software: you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation, either version 3 of the License, or
 * (at your option) any later version.
 * 
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 * 
 * You should have received a copy of the GNU General Public License
 * and the Lesser GNU General Public License along with this program.
 * If not, see <http://www.gnu.org/licenses/>.
 * 
 */

package org.davekeen.flextrine.orm {
	import mx.rpc.AsyncToken;
	import org.davekeen.collections.IndexedArrayCollection;
	
	/**
	 * ...
	 * @author Dave Keen
	 */
	public interface IEntityRepository {
		function get entities():IndexedArrayCollection;
		
		function load(id:Number, fetchMode:String = null):AsyncToken;
		function loadOneBy(criteria:Object, fetchMode:String = null):AsyncToken;
		function loadBy(criteria:Object, fetchMode:String = null):AsyncToken;
		function loadAll(fetchMode:String = null):AsyncToken;
		
		function find(id:Number):Object;
		function findOneBy(criteria:Object):Object;
		function findAll():Array;
		function findBy(criteria:Object):Array;
		
	}
	
}